package com.sky.controller.user;

import com.sky.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/user/shop")
@Api(tags = "商店状态用户端相关接口")
@Slf4j
public class ShopUserController {
    @Autowired
    private RedisTemplate redisTemplate;

    private static final String SHOP_STATUS = "SHOP_STATUS";

    /**
     * 获取店铺状态功能
     * @return
     */
    @GetMapping("/status")
    @ApiOperation("获取店铺状态接口")
    public Result getStatus(){
        return Result.success(redisTemplate.opsForValue().get(SHOP_STATUS));
    }
}
